<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta name="description" content="首先卸载你之前配置失败的webpack 卸载webpack：npm uninstall webpack -g 安装webpack  准备工作在桌面创建一个文件夹mkdir webpack-demo然后cd webpcak-demo 安装webpack全局安装：sudo npm i -g webpack@3.6.0查看是否安装成功：webpack --help看到如下图说明成功：接下来命令行输入：n">
<meta property="og:type" content="article">
<meta property="og:title" content="安装webpack及配置">
<meta property="og:url" content="http://yoursite.com/2018/06/10/安装webpack及配置/index.html">
<meta property="og:site_name" content="From&#39;s blog">
<meta property="og:description" content="首先卸载你之前配置失败的webpack 卸载webpack：npm uninstall webpack -g 安装webpack  准备工作在桌面创建一个文件夹mkdir webpack-demo然后cd webpcak-demo 安装webpack全局安装：sudo npm i -g webpack@3.6.0查看是否安装成功：webpack --help看到如下图说明成功：接下来命令行输入：n">
<meta property="og:locale" content="default">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-21da5032ac3460b3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/740">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-c9a91068e6875688.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-529a5938967fbf49.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-018f7d5c585c8fa9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/740">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-e0c0cda16a5196fe.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/740">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-5e564457b2c5b8d7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/740">
<meta property="og:updated_time" content="2018-06-10T15:55:32.060Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="安装webpack及配置">
<meta name="twitter:description" content="首先卸载你之前配置失败的webpack 卸载webpack：npm uninstall webpack -g 安装webpack  准备工作在桌面创建一个文件夹mkdir webpack-demo然后cd webpcak-demo 安装webpack全局安装：sudo npm i -g webpack@3.6.0查看是否安装成功：webpack --help看到如下图说明成功：接下来命令行输入：n">
<meta name="twitter:image" content="https://upload-images.jianshu.io/upload_images/11007474-21da5032ac3460b3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/740">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/06/10/安装webpack及配置/"/>





  <title>安装webpack及配置 | From's blog</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="default">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">From's blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/06/10/安装webpack及配置/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wang hang">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="From's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">安装webpack及配置</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-06-10T22:58:49+08:00">
                2018-06-10
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="首先卸载你之前配置失败的webpack"><a href="#首先卸载你之前配置失败的webpack" class="headerlink" title="首先卸载你之前配置失败的webpack"></a>首先卸载你之前配置失败的webpack</h3><hr>
<p>卸载webpack：<br>npm uninstall webpack -g</p>
<h3 id="安装webpack"><a href="#安装webpack" class="headerlink" title="安装webpack"></a>安装webpack</h3><hr>
<ul>
<li>准备工作<br>在桌面创建一个文件夹<br><code>mkdir webpack-demo</code><br>然后<code>cd webpcak-demo</code></li>
<li>安装webpack<br>全局安装：<code>sudo npm i -g webpack@3.6.0</code><br>查看是否安装成功：<code>webpack --help</code><br>看到如下图说明成功：<br><img src="https://upload-images.jianshu.io/upload_images/11007474-21da5032ac3460b3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/740" alt="image.png"><br>接下来命令行输入：<code>npm init</code><br>出现的填空全部点回车就好<h3 id="创建文件"><a href="#创建文件" class="headerlink" title="创建文件"></a>创建文件</h3>创建下面四个文件（划掉的不用创建）<br><img src="https://upload-images.jianshu.io/upload_images/11007474-c9a91068e6875688.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>内容分别是：<br>SRC / index.js：<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">import bar from &apos;./bar&apos;;</span><br><span class="line"></span><br><span class="line">bar();</span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>SRC / bar.js：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">export default function bar() &#123;</span><br><span class="line">  //</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>webpack.config.js：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">const path = require(&apos;path&apos;);</span><br><span class="line"></span><br><span class="line">module.exports = &#123;</span><br><span class="line">  entry: &apos;./src/index.js&apos;,</span><br><span class="line">  output: &#123;</span><br><span class="line">      path: path.resolve(__dirname, &apos;dist&apos;),</span><br><span class="line">    filename: &apos;bundle.js&apos;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure></p>
<p>page.html：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&lt;!doctype html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">  &lt;head&gt;</span><br><span class="line">    ...</span><br><span class="line">  &lt;/head&gt;</span><br><span class="line">  &lt;body&gt;</span><br><span class="line">    ...</span><br><span class="line">    &lt;script src=&quot;dist/bundle.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">  &lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure></p>
<p>然后命令行输入<code>webpack</code>如出现如下图<br><img src="https://upload-images.jianshu.io/upload_images/11007474-529a5938967fbf49.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>然后去你的文件夹看，出现了一个built的文件夹里面还有一个js文件<br>然后给你的webpack.config.js文件加如下代码<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">module: &#123;</span><br><span class="line">    rules: [</span><br><span class="line">      &#123;</span><br><span class="line">        test: /\.js$/,</span><br><span class="line">        exclude: /(node_modules|bower_components)/,</span><br><span class="line">        use: &#123;</span><br><span class="line">          loader: &apos;babel-loader&apos;,</span><br><span class="line">          options: &#123;</span><br><span class="line">            presets: [&apos;env&apos;]</span><br><span class="line">          &#125;</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;</span><br><span class="line">    ]</span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure></p>
<p>这里很多人加错，应该成为如下：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">const path = require(&apos;path&apos;)</span><br><span class="line"></span><br><span class="line">module.exports = &#123;</span><br><span class="line">  entry: &apos;./src/index.js&apos;,</span><br><span class="line">  output: &#123;</span><br><span class="line">    filename: &apos;bundle.js&apos;,</span><br><span class="line">    path: path.resolve(__dirname, &apos;dist&apos;)</span><br><span class="line">  &#125;,</span><br><span class="line">  module: &#123;</span><br><span class="line">    rules: [</span><br><span class="line">      &#123;</span><br><span class="line">        test: /\.js$/,</span><br><span class="line">        exclude: /(node_modules|bower_components)/,</span><br><span class="line">        use: &#123;</span><br><span class="line">          loader: &apos;babel-loader&apos;,</span><br><span class="line">          options: &#123;</span><br><span class="line">            presets: [&apos;env&apos;]</span><br><span class="line">          &#125;</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;</span><br><span class="line">    ]</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>好了继续在命令行输入<code>webpack</code><br>发现又特么错，是不是慌得一批，不要急，看报错<br><img src="https://upload-images.jianshu.io/upload_images/11007474-018f7d5c585c8fa9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/740" alt="image.png"><br>他不说没有<code>babel-loader</code>嘛，按上不就好了嘛<br>继续命令行输入：<code>npm i babel-loader</code><br>完成后继续输入<code>webpack</code><br>又错！<br><img src="https://upload-images.jianshu.io/upload_images/11007474-e0c0cda16a5196fe.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/740" alt="image.png"><br>不废话了，继续安装：<code>npm i babel-core</code><br>在运行<code>webpack</code>，<br><img src="https://upload-images.jianshu.io/upload_images/11007474-5e564457b2c5b8d7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/740" alt="image.png"></p>
<p>又特么错！是不是要疯了？</p>
<p>心中mmp的继续安装吧<br>他说我们没有env<br>运行’npm i babel-preset-env‘<br>再运行<code>wenpack</code></p>
<p>WCO！终于不报错了</p>
<p>打开文件夹中的page.html，发现毛都没有</p>
<p>来改一下 bar.js 吧：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">export default function bar() &#123;</span><br><span class="line">  alert(&apos;Hello Webpack!&apos;)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>在运行<code>webpack</code><br>点开文件，发现页面出现了Hello Webpack！</p>
<p>我们把js模块化<br>在src文件里创建js文件<br>在里面添加model1.js、model2.js（这两个是你要用的模块）<br>先要定义一下模块1和模块2<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">function fn() &#123;</span><br><span class="line">    console.log(2)</span><br><span class="line">&#125;</span><br><span class="line">export default fn  //如果有人引用我 我就把fn传给他</span><br></pre></td></tr></table></figure></p>
<p>1、2的内容可以一样<br>还有一个入口app.js<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">import x from &apos;./module-1&apos;       /得到一个文件从module1 x就是默认导出的那个fn（module里的那个）</span><br><span class="line">import y from &apos;./module-2&apos;</span><br><span class="line">import &apos;../css/main.scss&apos;</span><br><span class="line"></span><br><span class="line">x()</span><br><span class="line">console.log(&apos;傻逼webpack&apos;)</span><br><span class="line">y()</span><br></pre></td></tr></table></figure></p>
<p>这时候运行webpack就可以看到在dist里面的bundle.js里有我们下的两个模块的js文件</p>
<p>在src文件里创建js文件<br>在里面添加model1.js、model2.js（这两个是你要用的模块）<br>先要定义一下模块1和模块2<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">function fn() &#123;</span><br><span class="line">    console.log(2)</span><br><span class="line">&#125;</span><br><span class="line">export default fn  //如果有人引用我 我就把fn传给他</span><br></pre></td></tr></table></figure></p>
<p>1、2的内容可以一样<br>还有一个入口app.js<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">import x from &apos;./module-1&apos;       /得到一个文件从module1 x就是默认导出的那个fn（module里的那个）</span><br><span class="line">import y from &apos;./module-2&apos;</span><br><span class="line">import &apos;../css/main.scss&apos;</span><br><span class="line"></span><br><span class="line">x()</span><br><span class="line">console.log(&apos;傻逼webpack&apos;)</span><br><span class="line">y()</span><br></pre></td></tr></table></figure></p>
<p>这时候运行webpack就可以看到在dist里面的bundle.js里有我们下的两个模块的js文件</p>
<h3 id="接下来我们把css也转化一下吧"><a href="#接下来我们把css也转化一下吧" class="headerlink" title="接下来我们把css也转化一下吧"></a>接下来我们把css也转化一下吧</h3><hr>
<p>你需要配置一下内容<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">css-loader</span><br><span class="line">sass-loader</span><br><span class="line">style-loader</span><br><span class="line">node-sass</span><br></pre></td></tr></table></figure></p>
<p>然后在webpack.config.js里的rules后面加上<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    test: /\.scss$/,     //获取要输出的文件格式</span><br><span class="line">    use: [&#123;</span><br><span class="line">        loader: &quot;style-loader&quot;      //第三部 把刚才的common js字符串转为style</span><br><span class="line">    &#125;, &#123;</span><br><span class="line">        loader: &quot;css-loader&quot;       //第二部，把css转为common js字符串</span><br><span class="line">    &#125;, &#123;</span><br><span class="line">        loader: &quot;sass-loader&quot;,     //获取后第一步 把sass转为css</span><br><span class="line">        options: &#123;</span><br><span class="line">            includePaths: [&quot;absolute/path/a&quot;, &quot;absolute/path/b&quot;]</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>说明已经基本的配置完成！<br>是不是真的很难用啊～<br>%&gt;_&lt;%～</p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/06/06/button绑定事件的三种方式/" rel="next" title="button绑定事件的三种方式">
                <i class="fa fa-chevron-left"></i> button绑定事件的三种方式
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/06/21/jpg-png格式的图片的差别和使用场景/" rel="prev" title="jpg/png格式的图片的差别和使用场景">
                jpg/png格式的图片的差别和使用场景 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            Overview
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Wang hang</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">52</span>
                  <span class="site-state-item-name">posts</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                
                  <span class="site-state-item-count">2</span>
                  <span class="site-state-item-name">tags</span>
                
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#首先卸载你之前配置失败的webpack"><span class="nav-number">1.</span> <span class="nav-text">首先卸载你之前配置失败的webpack</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装webpack"><span class="nav-number">2.</span> <span class="nav-text">安装webpack</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#创建文件"><span class="nav-number">3.</span> <span class="nav-text">创建文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#接下来我们把css也转化一下吧"><span class="nav-number">4.</span> <span class="nav-text">接下来我们把css也转化一下吧</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wang hang</span>

  
</div>


  <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a></div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">Theme &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
